import Ajax from './Ajax'

export const loginApi = data => {
    return Ajax({
        url:'/user/login',
        method:'POST',
        data
    })
}

export const userInfoApi = id => {
    return Ajax({
        url:'/user/info',
        params:{id}
    })
}

export const updatePwdApi = data => {
    return Ajax({
        url:'/user/update',
        method:'POST',
        data
    })
}

export const userListApi = params => {
    return Ajax({
        url: '/user/list',
        params
    })
}

export const fileUploadApi = (data, cb) => {
    return Ajax({
        url: '/file/upload/photo',
        method: 'POST',
        data,
        fileUpload: cb
    })
}

export const roleListApi = () => Ajax({url: '/role/list'})

export const deptListApi = () => Ajax({url: '/dept/list'})

export const saveUserApi = data => {
    return Ajax({
        url: '/user/save',
        method: 'POST',
        data
    })
}